# $Id: PKGBUILD 67878 2012-03-15 16:04:45Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Andreas Wagner <Andreas dot Wagner at em dot uni-frankfurt dot de>

pkgname=sux
pkgver=1.0.1
pkgrel=2
pkgdesc="A wrapper around su which will transfer your X credentials"
arch=('any')
url="http://sourceforge.net/projects/sux/"
license=("custom")
depends=('coreutils' 'xorg-xauth')
source=(http://downloads.sourceforge.net/project/sux/sux/$pkgver/sux-$pkgver.tar.gz)
md5sums=('73613f8515e0d90bdd9e871b6fe2e2eb')

build() {
  cd ${srcdir}/sux-$pkgver
  sed -i -e 's|tempfile -p sux|mktemp --tmpdir sux.XXXXXXXXXX|' sux
  sed -i -e 's|tempfile -p sux|mktemp --tmpdir sux.XXXXXXXXXX|' suxterm
}

package() {
  cd ${srcdir}/sux-$pkgver
  install -D -m775 sux  ${pkgdir}/usr/bin/sux
  install -D -m775 suxterm  ${pkgdir}/usr/bin/suxterm
  install -D -m644 debian/sux.1 ${pkgdir}/usr/share/man/man1/sux.1
  install -D -m644 debian/suxterm.1 ${pkgdir}/usr/share/man/man1/suxterm.1
  install -D -m644 debian/copyright ${pkgdir}/usr/share/licenses/sux/COPYING
}
